package com.seh.contentcenter.utils;

import cn.hutool.core.bean.BeanUtil;
import com.seh.contentcenter.dto.*;
import com.seh.contentcenter.entity.*;

public class DTOUtil {

    public static AddressInfoDTO convertAddress(AddressInfo addressInfo) {
        AddressInfoDTO addressInfoDTO = new AddressInfoDTO();
        BeanUtil.copyProperties(addressInfo, addressInfoDTO);
        return addressInfoDTO;
    }

    public static CommentDTO convertComment(Comment comment) {
        CommentDTO commentDTO = new CommentDTO();
        BeanUtil.copyProperties(comment, commentDTO);
        return commentDTO;
    }

    public static CommentsDTO convertComments(Comments comments) {
        CommentsDTO commentsDTO = new CommentsDTO();
        BeanUtil.copyProperties(comments, commentsDTO);
        return commentsDTO;
    }

    public static DeliverDTO convertDeliver(Deliver deliver) {
        DeliverDTO deliverDTO = new DeliverDTO();
        BeanUtil.copyProperties(deliver, deliverDTO);
        return deliverDTO;
    }

    public static GoodsDTO convertGoods(Goods goods) {
        GoodsDTO goodsDTO = new GoodsDTO();
        BeanUtil.copyProperties(goods, goodsDTO);
        return goodsDTO;
    }

    public static OrderDTO convertOrder(Order order) {
        OrderDTO orderDTO = new OrderDTO();
        BeanUtil.copyProperties(order, orderDTO);
        return orderDTO;
    }

    public static PostDTO convertPost(Post post) {
        PostDTO postDTO = new PostDTO();
        BeanUtil.copyProperties(post, postDTO);
        return postDTO;
    }

    public static ReplyDTO convertReply(Reply reply) {
        ReplyDTO replyDTO = new ReplyDTO();
        BeanUtil.copyProperties(reply, replyDTO);
        return replyDTO;
    }

}
